import Vue from 'vue'
import Router from 'vue-router'
import '../theme/index.css'
import ExportApplyResultList from "../components/knowledge/ExportApplyResultList";
import Edit from "../components/term/Edit"
import FormulaEditor from "../components/calculator/FormulaEditor";
import KnowledgeEdit from '../components/knowledge/knowledgeEdit/KnowledgeEdit'
import FormulaType from "../components/calculator/FormulaType";
import DescriptionType from "../components/calculator/exportModel/DescriptionType";
import ScoreType from "../components/calculator/exportModel/ScoreType";
import Login from "../components/Login";
import Amend from "../components/Amend";
import New from "../components/knowledgeLibFiled/New";
import TempKnowledgeTable from "../components/knowledgeLibFiled/manage/TempKnowledgeTable";
import Manage from "../components/knowledgeLibFiled/manage/Manage";
import SynchronizationSearch from "../components/knowledgeLibFiled/manage/SynchronizationSearch";
import KnowledgeLibManage from "../components/knowledgeLibFiled/KnowledgeLibManage";
import SynchronizationTable from "../components/knowledgeLibFiled/manage/SynchronizationTable";
import SyncLog from "../components/knowledgeLibFiled/manage/SynchronizationLog";
import KnowledgeDetail from "../components/KnowledgeDetail/KnowledgeDetail";
import exportKnowledge from "../components/knowledgeLibFiled/manage/exportKnowledge";
import Recycle from "../components/knowledgeLibFiled/manage/Recycle";
import KnowledgeFieldCompare from "../components/knowledgeLibFiled/manage/KnowledgeFieldCompare";
import Draft from "../components/book/DraftTable";
import BookLog from "../components/book/BookLog";
import ShowMetadata from "../components/book/ShowMetadata";
import ShowIncreaseMetadata from "../components/book/ShowIncreaseMetadata"
import EditMetadata from "../components/book/EditMetadata";
import BookDetail from "../components/book/BookDetail";
import OfficialTable from "../components/book/OfficialTable";
import MakeFlowChart from "../components/joint/index";
import ViewFlowChart from "../components/joint/browse";
import BookLib from "../components/book/BookLib";
import JournalLib from "../components/journal/JournalLib"
import Term from "../components/term/Term";
import ShowLog from "../components/knowledgeLibFiled/manage/ShowLog";
import Log from "../components/knowledgeLibFiled/manage/Log";
import mobileViewFlowChart from "../components/joint/mobileBrowse";
import ReleaseAndSyncTab from "../components/calculator/ReleaseAndSyncTab";
import CalculatorLog from "../components/calculator/CalculatorLog";
import Platform from "../components/platform/platformIndex"
import PlatformKnowledgeLib from "../components/platform/platformKL"
import MedicalCalculatorAuditTable from "../components/calculator/MedicalCalculatorAuditTable";
import CalculatorOption from "../components/calculator/CalculatorOption";
import MedicalCalculatorSyncTable from "../components/calculator/MedicalCalculatorSyncTable";
import SyncCalculatorLog from "../components/calculator/SyncCalculatorLog";
import FlowChartManage from "../components/flowchart/FlowChartManage";
import FlowChartLog from "../components/flowchart/FlowChartLog";
import ReleasedFlowChart from "../components/flowchart/ReleasedFlowChart";
import AllTaskList from "../components/task/taskList/AllTaskList";
import SelfTaskList from "../components/task/taskList/SelfTaskList";
import TaskEditManage from "../components/task/taskEdit/TaskEditManage";
import NewTask from "../components/task/newTask/NewTask";
import TaskEdit from "../components/task/TaskEdit";
import BookTermDetail from "../components/term/BookTermDetail";
import DetailStandard from "../components/term/DetailStandard";
import TaskDetailWrapper from "../components/task/taskDetail/TaskDetailWrapper";
import TagIndex from "../components/tag/TagIndex";
import SchemeWork from "../components/work/SchemeWork";
import EditWork from "../components/work/EditWork";
import AuditWork from "../components/work/AuditWork";
import Metadata from "../components/term/Metadata";
import StandardTerm from "../components/term/StandardTerm";
import Update from "../components/term/Update";
import BookTermBetweenDetail from "../components/term/BookTermBetweenDetail";
import StandardTermEdit from "../components/term/StandardTermEdit";
import TermHistory from "../components/term/history/TermHistory";
import TermLibHistory from "../components/term/history/TermLibHistory";
import TermLibDetail from "../components/term/history/TermLibDetail";
import TermBetweenEdit from "../components/term/TermBetweenEdit";
import TermBetweenDetail from "../components/term/TermBetweenDetail";
import SubTaskItem from "../components/task/taskEdit/SubTaskItem";
import WordsOfficialTable from "../components/words/WordsOfficialTable";
import WordsDraftTable from "../components/words/WordsDraftTable"
import WordsRecycle from "../components/words/WordsRecycle"
import UserTable from "../components/user/UserTable"
import RoleTable from "../components/role/RoleTable"
import UncommonWord from "../components/uncommonWord/UncommonWordIndex"
import JournalMetadata from "../components/journal/JournalMetadata";
import JournalDetail from "../components/journal/JournalDetail";
import ArticleDetail from "../components/journal/ArticleDetail";
import JournalArticleMetadata from "../components/journal/JournalArticleMetadata";
import BookTable from '../components/mark/BookTable'
import ExtractKnowledgeUnit from '../components/mark/ExtractKnowledgeUnit'
import MarkKnowledgeUnit from '../components/mark/MarkKnowledgeUnit'
import Index from "../components/Index"
import ActivityListTable from "../components/activity/ActivityListTable"
import ActivityDetail from "../components/activity/ActivityDetail"
import MyActivityTable from "../components/activity/MyActivityTable"
import MaterialTable from "../components/material/MaterialTable"
import UserManage from "../components/user/UserManage"
import ResourceTable from "../components/role/ResourceTable"
import CreateKnowledgeByKnowledgeUnit from '../components/material/CreateKnowledgeByKnowledgeUnit'
import MultiCreateKnowledge from '../components/material/MultiCreateKnowledge'
import SameKnowledgeUnitField from '../components/material/SameKnowledgeUnitField'
import TaskHistory from '../components/material/TaskHistory'
import TaskItemHistory from '../components/material/TaskItemHistory'
import TaskItemDetail from '../components/material/TaskItemDetail'
import MyAudit from "../components/myAudit/MyAudit";

import TermDetail from "../components/term/TermDetail"
import Push from "../components/term/Push"
import BookPush from "../components/term/BookPush"
import CalculatorRecycle from "../components/calculator/CalculatorRecycle"
import FlowChartRecycle from "../components/flowchart/FlowChartRecycle"
import OperationLogTable from "../components/operationLog/OperationLogTable"

import bookAdd from "../components/increaseBook/bookAdd"
import resourceUpload from "../components/increaseBook/resourceUpload"
import generateQrcode from "../components/increaseBook/generateQrcode"
import bookList from "../components/increaseBook/bookList"
import SpecialtyKnowledgeLibList from "../components/specialtyKnowledgeLib/SpecialtyKnowledgeLibList"
import EditExerciseGroup from "../components/exerciseBook/EditExerciseGroup";

import WordResult from "../components/activity/wordResult"
import ExerciseGroupTable from "../components/exerciseBook/ExerciseGroupTable";
import CreateExerciseGroupLib from "../components/exerciseLib/CreateExerciseGroupLib";
import ExerciseLibIndex from "../components/exerciseLib/ExerciseLibIndex";
import List from "../components/examOutline/List";
import Detail from "../components/examOutline/Detail";
import GuideBookTable from "../components/examGuideBook/GuideBookTable";
import ShowKnowledgeTable from "../components/examGuideBook/ShowKnowledgeTable";
import ExamExerciseTable from "../components/examGuideBook/ExamExerciseTable";
import GuideBookDetail from "../components/examGuideBook/GuideBookDetail";
import ExerciseIndex from "../components/exerciseBook/ExerciseIndex";
import KnowledgeAndExercise from "../components/examGuideBook/KnowledgeAndExercise";
import ExerciseGroupLibTable from "../components/exerciseLib/ExerciseGroupLibTable";
import NewExamBookKnowledge from "../components/examGuideBook/NewExamBookKnowledge";
import EditIncreaseMetadata from "../components/book/EditIncreaseMetadata"

// 解决ElementUI导航栏中的vue-router在3.0版本以上重复点菜单报错问题
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/amend',
      component: Amend
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/increaseBook/bookAdd',
          component: bookAdd,
          name: 'bookAdd',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/increaseBook/resourceUpload',
          component: resourceUpload,
          name: 'resourceUpload',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/myAudit',
          component: MyAudit,
          name: 'MyAudit'
        },
        {
          path: '/increaseBook/generateQrcode',
          component: generateQrcode,
          name: 'generateQrcode',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/increaseBook/bookList',
          component: bookList,
          name: 'increase',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/term',
          component: Term,
          name: 'term',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/term/edit',
          component: Edit
        },
        {
          path: '/term/bookTermDetail',
          component: BookTermDetail,
          name: 'BookTermDetail',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/term/bookTermBetweenDetail',
          component: BookTermBetweenDetail,
          name: 'BookTermBetweenDetail'
        },
        {
          path: '/term/update',
          component: Update
        },
        {
          path: '/term/detailStandard',
          component: DetailStandard
        },
        {
          path: '/term/Metadata',
          component: Metadata
        },
        {
          path: '/term/termStandard',
          component: StandardTerm
        },
        {
          path: '/term/push',
          component: Push
        },
        {
          path: '/formula/editor',
          component: FormulaEditor
        },
        {
          path: '/knowledge/edit',
          component: KnowledgeEdit,
          name: 'KnowledgeEdit',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/formulaType',
          component: FormulaType
        },
        {
          path: '/descriptionType',
          component: DescriptionType
        },
        {
          path: '/scoreType',
          component: ScoreType
        },
        {
          path: '/new',
          component: New
        },
        {
          path: '/temp',
          component: TempKnowledgeTable,
          name: 'TempKnowledge',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/manage',
          component: Manage,
          name: 'manage',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/search',
          component: SynchronizationSearch
        },
        {
          path: '/KnowledgeLib',
          component: KnowledgeLibManage,
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/exportApplyResultList',
          component: ExportApplyResultList
        },
        {
          path: '/syn',
          component: SynchronizationTable
        },
        {
          path: '/knowledgeDetail',
          name: 'knowledgeDetail',
          component: KnowledgeDetail
        },
        {
          path: '/log',
          component: Log
        },
        {
          path: '/syncLog',
          component: SyncLog
        },
        {
          path: '/exportKnowledge',
          name: 'exportKnowledge',
          component: exportKnowledge
        },
        {
          path: '/recycle',
          component: Recycle
        },
        {
          path: '/knowledgeLib/compare',
          component: KnowledgeFieldCompare
        },
        {
          path: '/draft',
          component: Draft
        },
        {
          path: '/bookLog',
          component: BookLog
        },
        {
          path: '/showMetadata',
          component: ShowMetadata
        },
        {
          path: '/showIncreaseMetadata',
          component: ShowIncreaseMetadata
        },
        {
          name: 'editMetadata',
          path: '/editMetadata',
          component: EditMetadata
        },
        {
          name: 'editIncreaseMetadata',
          path: '/editIncreaseMetadata',
          component: EditIncreaseMetadata
        },
        {
          path: '/bookDetail',
          component: BookDetail
        },
        {
          path: '/official',
          component: OfficialTable
        },
        {
          path: '/bookLib',
          component: BookLib,
          name: 'BookLib',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/showLog',
          component: ShowLog
        },
        {
          path: '/releaseAndSyncTab',
          component: ReleaseAndSyncTab,
          name: 'ReleaseAndSyncTab',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/platform',
          component: Platform
        },
        {
          path: '/platformKnowledgeLib',
          name: 'platformKnowledgeLib',
          component: PlatformKnowledgeLib
        },
        {
          path: '/calculatorLog',
          component: CalculatorLog
        },
        {
          path: '/calculatorAudit',
          component: MedicalCalculatorAuditTable,
        },
        {
          path: '/calculatorOption',
          component: CalculatorOption
        },
        {
          path: '/calculatorSync',
          component: MedicalCalculatorSyncTable
        },
        {
          path: '/syncCalculatorLog',
          component: SyncCalculatorLog
        },
        {
          path: '/flowChartManage',
          component: FlowChartManage,
          name: 'flowChartManage',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/flowChartLog',
          component: FlowChartLog
        },
        {
          path: '/releasedFlowChart',
          component: ReleasedFlowChart
        },
        {
          path: '/tasks/all',
          component: AllTaskList,
          name: 'AllTaskList',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/tasks/self',
          component: SelfTaskList,
          name: 'SelfTaskList',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        },
        {
          path: '/taskEditManage',
          component: TaskEditManage,
          name: 'taskEditManage',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        }, {
          path: "/task/new",
          component: NewTask
        }, {
          path: "/task/edit",
          component: TaskEdit
        }, {
          path: "/task/detail",
          component: TaskDetailWrapper
        }, {
          path: "/tagIndex",
          component: TagIndex
        }, {
          path: "/SchemeWork",
          component: SchemeWork
        }, {
          path: "/EditWork",
          component: EditWork
        }, {
          path: "/AuditWork",
          component: AuditWork
        }, {
          path: "/standardTermEdit",
          component: StandardTermEdit
        }, {
          path: "/term/history",
          component: TermHistory
        }, {
          path: "/term/lib/history",
          component: TermLibHistory
        }, {
          path: "/term/lib/detail",
          component: TermLibDetail
        }, {
          path: "/term/betweenEdit",
          component: TermBetweenEdit
        }, {
          path: "/term/betweenDetail",
          component: TermBetweenDetail
        }, {
          path: "/term/bookPush",
          component: BookPush,
          name: "BookPush"
        }, {
          path: "/task/subTaskItem",
          component: SubTaskItem
        }, {
          path: '/journalLib',
          component: JournalLib,
          name: 'JournalLib',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        }, {
          path: "/word/officialTable",
          component: WordsOfficialTable
        }, {
          path: "/word/draftTable",
          component: WordsDraftTable
        }, {
          path: "/word/recycle",
          component: WordsRecycle
        }, {
          path: "/user",
          component: UserTable
        },
        {
          path: '/userManage',
          component: UserManage,
        }, {
          path: "/role",
          component: RoleTable
        },
        {
          path: "/resourceTable",
          component: ResourceTable
        }, {
          path: '/journalLib/Metadata',
          component: JournalMetadata
        }, {
          path: '/journalLib/Detail',
          component: JournalDetail,
          name: 'JournalDetail',
          meta: {
            keepAlive: true,
            isUseCache: false
          }
        }, {
          path: '/journalLib/articleDetail',
          component: ArticleDetail
        }, {
          path: '/journalLib/articleMetadata',
          component: JournalArticleMetadata
        }, {
          path: "/uncommonWord",
          component: UncommonWord,
        }, {
          path: "/mark/bookTable",
          component: BookTable,
        }, {
          path: "/mark/extractKnowledgeUnit",
          component: ExtractKnowledgeUnit,
        }, {
          path: "/mark/markKnowledgeUnit",
          component: MarkKnowledgeUnit,
        },
        {
          path: '/activity/list',
          component: ActivityListTable
        },
        {
          path: '/activity/detail',
          component: ActivityDetail
        },
        {
          path: '/activity/myActivity',
          component: MyActivityTable
        },
        {
          path: '/material',
          component: MaterialTable
        },
        {
          path: '/term/termDetail',
          component: TermDetail
        },
        {
          path: '/createKnowledgeByKnowledgeUnit',
          component: CreateKnowledgeByKnowledgeUnit
        },
        {
          path: '/multiCreateKnowledge',
          component: MultiCreateKnowledge
        },
        {
          path: '/sameKnowledgeUnitField',
          component: SameKnowledgeUnitField
        },
        {
          path: '/material/taskHistory',
          component: TaskHistory,
        },
        {
          path: '/material/taskItemHistory',
          component: TaskItemHistory,
        },
        {
          path: '/material/taskItemDetail',
          component: TaskItemDetail,
        },
        {
          path: '/calculatorRecycle',
          component: CalculatorRecycle
        },
        {
          path: '/flowChartRecycle',
          component: FlowChartRecycle
        }
        ,
        {
          path: '/specialtyKnowledgeLibList',
          component: SpecialtyKnowledgeLibList
        },
        {
          path: '/operationLog',
          component: OperationLogTable
        },
        {
          path: '/wordResult',
          component: WordResult
        },
        {
          path: '/exerciseBook',
          component: ExerciseIndex
        },
        {
          path: '/exerciseBook/exerciseGroupTable',
          component: ExerciseGroupTable,
        },
        {
          path: '/exerciseBook/editExerciseGroup',
          component: EditExerciseGroup,
        },
        {
          path: '/exerciseLib',
          component: ExerciseLibIndex,
        },
        {
          path: '/exerciseLib/createExerciseGroupLib',
          component: CreateExerciseGroupLib,
        },
        {
          path: '/exerciseLib/editExerciseGroup',
          component: EditExerciseGroup,
        },
        {
          path: '/examOutline/list',
          component: List
        },
        {
          path: '/examOutline/detail',
          component: Detail,
          name: 'detail'
        },
        {
          path: '/guideBookTable',
          component: GuideBookTable,
        },
        {
          path: '/showKnowledgeTable',
          component: ShowKnowledgeTable,
        },
        {
          path: '/examExerciseTable',
          component: ExamExerciseTable,
        },{
          path: '/guideBook/detail',
          component: GuideBookDetail,
        },{
          path: '/guideBook/knowledgeAndExercise',
          component: KnowledgeAndExercise,
        },{
          path: '/exerciseGroupLibTable',
          component: ExerciseGroupLibTable,
        },{
          path: '/newExamBookKnowledge',
          component: NewExamBookKnowledge,
        },{
          path: '/knowledgeTable',
          component: () => import('@/components/knowledge/KnowledgeTable')
        },{
          path: '/esArticleTable',
          component: () => import('@/components/book/EsArticleTable')
        },
      ]
    },
    {
      path: '/knowledgeLib/MakeFlowChart',
      component: MakeFlowChart
    },
    {
      path: '/flowchart/ViewFlowChart',
      component: ViewFlowChart
    },
    {
      path: '/flowchart/mobileViewFlowChart',
      component: mobileViewFlowChart
    }

  ]
})
